package com.guaoran.study.java8;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author : gu cheng
 * @description : java.util.Date 线程安全问题
 * @date : 2021/11/15 14:37
 */
public class SimpleDateFormatTest {
    public static void main(String[] args) throws ParseException {
        Date date = new Date();
        System.out.println(date);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = sdf.format(date);
        System.out.println(format);
        Date parse = sdf.parse(format);
        System.out.println(parse);
    }
}
